
import 'dart:convert';

import 'package:flutter/services.dart';
import 'package:u9mobile/models/template.dart';
/// 模板
class TemplateRepository{
  Future<Template> fetchTemplate() async {
    try {
      String template = await rootBundle.loadString('template.json');
      dynamic templateMap = json.decode(template);
      return Template.fromJson(templateMap);
    } catch (e) {
      throw Exception('获取模板失败：$e');
    }
  }
}